namespace TerritoryGame.Domain.ValueObjects;

/// <summary>
/// 画笔大小值对象
/// </summary>
public record BrushSize
{
    public int Value { get; }
    
    public BrushSize(int value)
    {
        if (value < 1 || value > 50)
            throw new ArgumentException("画笔大小必须在1-50之间", nameof(value));
            
        Value = value;
    }
    
    public static implicit operator int(BrushSize brushSize) => brushSize.Value;
    
    public override string ToString() => Value.ToString();
}
